package com.auto.learning.view;

import com.auto.learning.R;

import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

public class MyToast {
public MyToast(Context context,String title,String message ){
	  LayoutInflater inflater = LayoutInflater.from(context);
	  View view = inflater.inflate(R.layout.my_toast, null);
	  TextView tv_title = (TextView) view.findViewById(R.id.tv_title);
	  TextView tv_message = (TextView) view.findViewById(R.id.tv_message);
	  tv_message.setText(message);
	  tv_title.setText(title);
	  Toast toast = new Toast(context);
	  toast.setGravity(Gravity.CENTER, 0,0);
	  toast.setDuration(Toast.LENGTH_LONG);
	  toast.setView(view);
	  toast.show();
}
}
